<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <title>智能声像全景管理系统</title>
    <link rel="shortcut icon" href="statics/topjui/images/favicon.ico"/>
    <link href="/statics/css/login.css" rel="stylesheet" type="text/css" />
    <script src="/statics/js/base/base.util.js?v=${v}"></script>
    <script type="/text/javascript">
        if(window.top!=window){
            window.top.location.href=window.location.href;
        }
    </script>
</head>

<body>

<div class="login_head">
    <div class="login_l_img">
        <div class="login_box_div">
            <div class="login_img_div"></div>
            <div class="left login_title_div">
                <p class="logo-text-p1">智能声像全景管理系统</p>
                <p class="logo-text-p2">WEIDENG PUHUI</p>
            </div>
        </div>
    </div>
</div>
<div class="content">
    <!-- <div class="content"> -->
    <div class="login_box" id="rrapp">
        <div class="login_content">
            <div class="login">
                <div>
                    <div class="login-background">
                        <div class="login-input center">
                            <div class="login-input-top center">
                                帐号登录
                            </div>
                            <input autocomplete="off" name="username" type="text" placeholder="账号" style="margin-top: 25px;" class="username-input">
                            <input autocomplete="off" name="password" type="password" placeholder="密码" class="password-input password-font1"/>
                            <input style="margin-top: 50px;" id="btn-login" class="login-button" value="登 录" type="button" @click="login">
                            <div class="alert alert-danger alert-dismissible" style="padding-top: 0px;text-align: center;">
                                <h4 id="msg-tip" style="margin-top: 5px;height:15px;font-size: 12px;color: #ff0000;padding-bottom: 32px;"></h4>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
    <!-- </div> -->
</div>
<div class="login_foot">
    <div class="foot-text">
        Copyright © 2017-2020
        <a href="http://www.witarchive.com" target="_blank">
            重庆威登普慧信息科技有限公司 All Rights Reserved
        </a>
    </div>
</div>
<!-- /.login-box -->
<script src="/statics/plugins/jquery/jquery-3.4.1.min.js?v=${v}"></script>
<script src="/statics/plugins/vue/vue.js?v=${v}"></script>
<script src="/statics/js/base/base.util.extend.js?v=${v}"></script>

<!--<link type="text/css" href="statics/plugins/layui/css/layui.css" rel="stylesheet"/>
<script type="text/javascript" src="statics/plugins/layui/layui.all.js?v=${v}"></script>-->
<!-- 引入表单验证 -->
<script type="text/javascript" src="/statics/plugins/nicevalidator/jquery.validator.min.js?local=zh-CN"></script>

<script type="text/javascript">
    $(function(){
        $('.login').validator({
            timely: 2,
            stopOnError: true,
            target1:"#msg-tip",
            target:function(elem){
                return $("#msg-tip");
            },
            validation:function(element, result){
                if(result.isValid){
                    $("#msg-tip").html("");
                }
            },
            msgMaker: function(opt){
                setTimeout(function(){
                    $("#msg-tip").html(opt.msg);
                },10);
                return "";
            },
            fields:{
                username:{
                    rule:"手机号:required;username;",
                    msg:{
                        required:'账号必须输入',
                        username:'账号格式错误,账号是4-20位字母或数字'
                    }
                },
                password:{
                    rule:"登陆密码:required;password;",
                    msg:{
                        required:'登陆密码必须输入',
                        password:'登陆密码格式错误'
                    }
                }
            }
        });

        $("#btn-login").click(function(){
            var data=BaseUtil.getFormData(".login");
            $('.login').isValid(function(r){
                if(r){
                    data["userType"]="manager";
                    BaseUtil.doPost("/sys/login",data,function(msg,data){
                        //登陆成功后,尝试选择档案馆
                        var url="/pages/index.html";
                        //var url="/pages/statics/plugins/win10ui/index.html";
                        parent.location.href = url;
                    },function(msg,result){
                        $("#msg-tip").html(msg||"注册账号错误");
                    });
                }
            });
        });

        $(document).keydown(function(event){
            if(event.keyCode==13){
                $("#btn-login").click();
            }
        });
    });
</script>

</body>
</html>